package cn.bjxy.shishaolong.request_answer.service;

import cn.bjxy.shishaolong.request_answer.entity.Collect;
import cn.bjxy.shishaolong.request_answer.mapper.CollectMapper;
import cn.bjxy.shishaolong.request_answer.service.ICollectService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 问答收藏表 服务实现类
 * </p>
 *
 * @author 时少龙
 * @since 2019-04-12
 */
@Service
public class CollectServiceImpl extends ServiceImpl<CollectMapper, Collect> implements ICollectService {

    @Autowired
    private CollectMapper collectMapper;

    @Override
    public IPage<Collect> queryByCondition(IPage<Collect> page, Collect collect) {
        List<Collect> collectList = collectMapper.queryByCondition(page, collect);
        return page.setRecords(collectList);
    }

    @Override
    public List<Collect> queryByCondition(Collect collect) {
        return collectMapper.queryByCondition(collect);
    }
}
